sysroot: Have `ensure_writable` also always initialize
authorColin Walters <walters@verbum.org>
Wed, 13 Jul 2022 19:35:00 +0000 (15:35 -0400)
committerColin Walters <walters@verbum.org>
Wed, 13 Jul 2022 19:35:00 +0000 (15:35 -0400)
commit75aa7a22f6d6499ade99f66f883dad2a3ebd413c
treeec1b75f2e32fa4e793819ea918608119f2b3e068
parent7e7a3df99b96107cc6ab521e4c1ad99d560282cd
sysroot: Have `ensure_writable` also always initialize

For historical reasons we have a fair bit of distinct sysroot
initialization going on.  A lot of code is calling *just* the new
`ensure_writable()` API, which does basically what you'd expect...
except if we're not using a mount namespace.

Which is the case in unit tests and legacy setups.
Change this API to also ensure the sysroot is fully initialized
even in those cases.  Specifically we'll have `self->sysroot_fd`.

For now, callers that need `/boot` also need to separately
call `_ensure_boot_fd()`.
src/libostree/ostree-sysroot.c